//
//  WaitOrdersCell.m
//  Recycling
//
//  Created by jzd on 2018/5/19.
//  Copyright © 2018年 宋佳. All rights reserved.
//

#import "WaitOrdersCell.h"
#import "orderModel.h"

@interface WaitOrdersCell ()
@property (weak, nonatomic) IBOutlet UIButton *refuseBut;//拒绝button
@property (weak, nonatomic) IBOutlet UILabel *telLab;//用户电话
@property (weak, nonatomic) IBOutlet UILabel *userName;//用户名
@property (weak, nonatomic) IBOutlet UILabel *userAddressLab;//用户地址
@property (weak, nonatomic) IBOutlet UILabel *transactionType;//绿色的收
@property (weak, nonatomic) IBOutlet UILabel *goodsName;//回收物品的名称
@property (weak, nonatomic) IBOutlet UILabel *agreementTime;//预约时间
@property (weak, nonatomic) IBOutlet UILabel *severceTime;//服务时长
@property (weak, nonatomic) IBOutlet UILabel *remindCount;//催单次数
@end
@implementation WaitOrdersCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.masksToBounds = YES;
    self.refuseBut.layer.borderColor = [UIColor darkGrayColor].CGColor;
    self.refuseBut.layer.borderWidth = 1.0;
}

-(void)setFrame:(CGRect)frame{
    frame = CGRectMake(frame.origin.x+5, frame.origin.y+5, frame.size.width-10, frame.size.height-10);
    [super setFrame:frame];
}
-(void)setModel:(orderModel *)model{
    _model = model;
    
    self.userName.text = model.UserName;
    self.telLab.text = model.UserTel;
    self.userAddressLab.text = model.UserAddress;
    self.goodsName.text = [NSString stringWithFormat:@"%@%@%@",model.ProBrandName,model.ProSpecName,model.ProTypeName];
    self.agreementTime.text = model.AppointmentDate;
    self.severceTime.text = model.ServiceDuration;
    self.remindCount.text = [NSString stringWithFormat:@"%d",model.RemindCount];
}
- (IBAction)refuseOrderOnClick:(UIButton *)sender {
    [[NSNotificationCenter defaultCenter]postNotificationName:refuseOrderNotification object:self.model userInfo:nil];
}
- (IBAction)accessOrderOnClick:(UIButton *)sender {
    [[NSNotificationCenter defaultCenter]postNotificationName:accessOrderNotification object:self.model userInfo:nil];
}

@end
